package com.wc.tt;

//事假，如果请假天数小于0.2，那么基本扣分减半，绩效分计算规则不变
public class GeneralAttence extends AbstractAttence {

    private static final GeneralAttence generalAttence = new GeneralAttence();

    private GeneralAttence() {

    }

    public static GeneralAttence getGeneralAttence() {
        return generalAttence;
    }
    @Override
    public double reduceBaseScore(double days, int type) {
        double score = LeaveType.getBaseScore(type);
        if (days < 0.2)
            score /= 2;
        return days * score;
    }

    @Override
    public double reducePerformanceScore(double days, int type) {
        return generalPerformanceScore(days, type);
    }
}
